** Important: run "R&P replication 2019 experiment" and "R&P replication 2021 experiment" do files first **

* Figures 3 and 4

reg friend_count cat_friend
eststo qexperiment_friend: margins, dydx(cat_friend) post coefl
eststo qdirect_friend: reg dq_friend 
coefplot qexperiment_friend qdirect_friend, ///
	name(maineffects1, replace) saving(21friend_levsdq.gph, replace) ///
	title("", margin(medlarge)) legend(off) vertical recast(bar) barwidth(0.75) ///
	ciopts(recast(rcap) lwidth(medthick)) citop format(%9.0f) scheme(s2color) ///
	coeflabels(cat_friend = "List experiment" _cons = "Direct question") ///
	ytitle("Estimated proportion", size(medium)) xtitle("") title("2021 September", size(medium)) ///
	yscale(range(.2 (.1) .7)) ylab(.2 (.1) .7, format(%9.1f))
graph display , ysize(1) xsize(1) scale(1) 


reg enemy_count cat_enemy
eststo qexperiment_enemy: margins, dydx(cat_enemy) post coefl
eststo qdirect_enemy: reg dq_enemy
coefplot qexperiment_enemy qdirect_enemy, ///
	name(maineffects2, replace) saving(21enemy_levsdq.gph, replace) ///
	title("", margin(medlarge)) legend(off) vertical recast(bar) barwidth(0.75) ///
	ciopts(recast(rcap) lwidth(medthick)) citop format(%9.0f) scheme(s2color) ///
	coeflabels(cat_enemy = "List experiment" _cons = "Direct question") ///
	ytitle("Estimated proportion", size(medium)) xtitle("") title("2021 September", size(medium)) ///
	yscale(range(0 (.1) .7)) ylab(0 (.1) .7, format(%9.1f))
graph display , ysize(1) xsize(1) scale(1) 

graph combine 19friend_levsdq.gph 21friend_levsdq.gph, ycommon col(2)
graph display , ysize(1) xsize(1.9) scale(1.3) margins(vsmall)
graph export "maineffects_combined_friend.png", replace

graph combine 19enemy_levsdq.gph 21enemy_levsdq.gph, ycommon col(2)
graph display , ysize(1) xsize(1.9) scale(1.3) margins(vsmall)
graph export "maineffects_combined_enemy.png", replace
